1. Field of the Invention
The present invention relates to an image forming device for printing text data and image data, and also to a layouter and a renderer connected to the image forming device.
2. Description of Related Art
When a printer prints text data and image data on a print medium, there are two cases. In one case, a terminal device such as a client computer transmits, to the printer, data containing, together with an XHTML (Extensible Hyper Text Markup Language) file including text data, image data related to the XHTML file (hereinafter referred to as multiplexed data). In the other case, the terminal device transmits, to the printer, only an XHTML file (hereinafter referred to as plain XHTML) and image data is downloaded to the printer. In the latter case, for downloading the image data, an URL (Uniform Resource Locator) is used, which is location information indicating the storage location of the image data on a network such as the Internet.
A printing operation of a printer that can cope with both cases will be described with reference to FIGS. 19 and 20. Multiplexed data is divided into data blocks each called chunk for receiving therein text data or image data. Multiplexed data received by the printer is in a state that each of image data and an XHTML file is received in one or more chunks. A chunk having received therein image data may be before or after a chunk including a tag <img> related to the image data.
First, in Step 801, it is judged whether or not data input of an XHTML file for printing has ended, that is, whether or not data read of the entire XHTML file has ended. When the data read is judged not to have ended, that is, NO in S801, the flow advances to Step 802. When the data read is judged to have ended, that is, YES in S801, the flow advances to Step 815.
In Step 802, it is judged whether or not data newly read includes therein a tag <img> concerning paste of image data. The tag <img> described therein the title and URL of image data to be displayed or printed together with text data when contents of the XHTML file are displayed or printed. When the data newly read is judged to include therein a tag <img>, that is, YES in S802, the flow advances to Step 804. When the data newly read is judged to include therein no tag <img>, that is, NO in S802, the flow advances to Step 803. In Step 803, other kinds of data processing, for example, layout processing for text data included in the XHTML file and read processing of XHTML data from a buffer, are performed. The flow then advances to Step 813.
In Step 804, it is judged whether data received from a client computer is multiplexed data or plain XHTML. This judgment is made based on input format information separately sent from the client computer. When the data is judged to be plain XHTML, that is, “Plain” in S804, the flow advances to Step 805. When the data is judged to be multiplexed data, that is, “Multiplexed” in S804, the flow advances to Step 806.
In Step 805, the printer connects, using Hypertext Transfer Protocol, to a server on an external network related to the URL described in the tag <img> of the XHTML file constituting the plain XHTML.
In Step 806, it is judged whether or not image data having the same URL as the URL described in the newly read data exists in a buffer. When it is concluded that no image data having the same URL exists, that is, NO in S806, the flow advances to Step 807. In Step 807, a chunk constituting the multiplexed data is read from the buffer. The flow then returns to Step 806. On the other hand, when it is concluded that image data having the same URL exists, that is, YES in 5806, the flow advances to Step 808.
In Step 808, the header of the image data existing on the server to which the printer connected in Step 805 in case of plain XHTML, or the header of the image data stored in the buffer in case of multiplexed data, is read, thereby acquiring dimensions information on the image data recorded in the header. Subsequently in Step 809, layout processing for the image data whose dimensions information has been acquired in Step 808 is performed on the basis of the acquired dimensions information.
In Step 810, like in Step 804, it is judged whether the data received from the client is multiplexed data or plain XHTML. When the data is judged to be multiplexed data, that is, “Multiplexed” in S810, the flow advances to Step 811. When the data is judged to be plain XHTML, that is, “Plain” in S810, the flow advances to Step 812.
In Step 811, the image data whose dimensions information has been read in Step 808 is written in the buffer. The image data written in the buffer is used in the later process as will be described with reference to FIG. 20. On the other hand, in step 812, the printer is disconnected from the server to which the printer has been connected in Step 805. The flow then advances to step 813.
In Step 813, it is judged whether or not layout processing for printing one page is performed. When layout processing for printing one page is judged to be performed, that is, YES in S813, the flow advances to step 814. In Step 814, layout data as intermediate data is output to perform printing one page. The flow then returns to Step 801. On the other hand, when layout processing for printing one page is judged not to be performed, that is, No in S813, the flow skips Step 814 and returns to Step 801.
In Step 815, it is judged whether or not unoutput layout data exists. When it is concluded that unoutput layout data exists, that is, YES in S815, the flow advances to Step 816. In Step 816, the unoutput layout data is output to perform printing one page. Layout processing is then ended. On the other hand, it is concluded that no unoutput layout data exists, that is, NO in S815, the flow skips Step 816 and layout processing is ended.
Next, details of processing for printing one page, i.e., rendering processing, in Step 814 or 816 in FIG. 19 will be described with reference to FIG. 20. In Step 901, it is judged whether or not inputting layout data of one page output in Step 814 or 816 has ended, that is, whether or not data read of the entire data related to the output layout data has ended. When the data read is judged not to have ended, that is, NO in S901, the flow advances to Step 902, When the data read is judged to have ended, that is YES in S901, the flow advances to Step 915.
In Step 902, it is judged whether or not data newly read includes therein a tag <img> concerning paste of image data. When the data newly read is judged to include therein a tag <img>, that is, YES in S902, the flow advances to Step 904. When the data newly read is judged to include therein no tag <img>, that is, NO in S902, the flow advances to Step 903. In Step 903, other kinds of data processing, for example, processing of rendering text data in accordance with a layout and data read processing from the buffer, are performed The flow then returns to Step 901.
In Step 904, it is judged whether data received from the client computer is multiplexed data or plain XHTML. When the data is judged to be plain XHTML, that is, “Plain” in S904, the flow advances to Step 905. When the data is judged to be multiplexed data, that is, “Multiplexed” in S904, the flow advances to Step 906.
In Step 905, the printer connects, using Hypertext Transfer Protocol, to a server on an external network related to the URL described in the tag <img> of the XHTML file constituting the plain XHTML. The flow then advances to Step 910.
In Step 906, it is judged whether or not the buffer stores therein multiplexed data. When the buffer is judged to store therein multiplexed data, that is, YES in S906, the flow advances to Step 907. In Step 907, the multiplexed data on the buffer is decoded. More specifically, image data in, e.g., JPEG format, is taken out from a chunk of the multiplexed data. The taken-out image data is stored in another area of the buffer. On the other hand, when the buffer is judged to store therein no multiplexed data, that is, NO in S906, the flow skips Step 907 and advances to Step 908.
In Step 908, it is judged whether or not image data having the same URL as the URL described in the newly read chunk exists in the buffer. When it is concluded that no image data having the same URL exists, that is, NO in S908, the flow advances to Step 909. In Step 909, the next chunk is read from the buffer. The flow then returns to Step 908. On the other hand, when it is concluded that image data having the same URL exists, that is, YES in S908, the flow advances to Step 910.
In Step 910, the image data existing on the server to which the printer connected in Step 905 in case of plain XHTML, or the image data stored in the buffer in case of multiplexed data, is read. The read image data is decoded to be converted into bitmap data. In Step 911, the bitmap data, corresponding to one image, decoded in Step 910, is output to the buffer in accordance with layout data.
In Step 912, it is again judged whether the data received from the client is multiplexed data or plain XHTML. When the s data is judged to be plain XHTML, that is, “Plain” in S912, the flow advances to Step 913. When the data is judged to be multiplexed data, that is, “Multiplexed” in S912, the flow advances to Step 914.
In Step 913, the printer is disconnected from the server to which the printer has been connected in step 905. The flow then returns to Step 901. On the other hand, in Step 914, the multiplexed data is deleted from the buffer, that is, the contents buffer is released. The flow then returns to Step 901.
In Step 915 executed when the layout data input is judged to be completed, rendering data, which is obtained by performing rendering of text data or image data for printing one page and includes therein data of one or more images, is output to a print engine. Rendering processing is then ended.
In the above-described printer that can cope with both of multiplexed data and plain XHTML, it must be judged in either of layout processing and rendering processing whether the data being received from the client is multiplexed data or plain XHTML. Besides, in accordance with the judgment results, image data must be acquired from one of the buffer and the server on the external network. Therefore, if there is a change in format of the data being received from the client, which data may be referred to as “input data” in the below description, or there is an added format, both of layout processing and rendering processing must be changed accordingly. Rapid solution of this problem is desired from the viewpoint of shortening the development period of printer and decreasing the development cost.